package com.chapter_1;

/**
 * @Author: Timo
 * @Date: 2019/4/29 17:09
 * @Description:  Single Threaded Execution 模式<br/>
 * 表示一个资源只能是有一个线程在占有，当A占有该资源的时候其余的线程只能是等待<br/>
 *
 *
 *
 *
 *
 *
 */
public class SingleThreadExecution {

    public static void main(String[] args){
        System.out.println("Testing Gate , hit CTRL+C to exit......");
        Gate gate = new Gate();
        new UserThread(gate, "Alice", "Alaska").start();
        new UserThread(gate, "Bobby", "Brazil").start();
        new UserThread(gate, "Chris", "Canada").start();
    }
}
